import requests
from utils.log_util import logger

host = "http://43.136.100.191:9090"

class Request:
    log = logger().getlog()

    def get(self,url,**kwargs):
        self.log.info("准备发起get请求:"+url)
        self.log.info("接口信息:{}".format(kwargs))

        r = requests.get(url=url,**kwargs)

        self.log.info("接口响应状态码:{}".format(r.status_code))
        self.log.info("接口响应的内容:{}".format(r.text))

        return r

    def post(self,url,**kwargs):
        self.log.info("准备发起get请求:"+url)
        self.log.info("接口信息:{}".format(kwargs))

        r = requests.post(url=url,**kwargs)

        self.log.info("接口响应状态码:{}".format(r.status_code))
        self.log.info("接口响应的内容:{}".format(r.text))

        return r